//
//  YWDetailWorkTableViewCell.m
//  maintain
//
//  Created by 郑想 on 16/7/28.
//  Copyright © 2016年 ewin. All rights reserved.
//

#import "YWDetailWorkTableViewCell.h"
#import "UIColor+CustomColors.h"
#import "UIImageView+WebCache.h"
#import "UIView+Extension.h"
#import "YWAnimationView.h"
#import "YWBuilding.h"
#import "YWBuildingManager.h"
#import "YWCommonTool.h"
#import "YWEquipmentManager.h"
#import "YWHandler.h"
#import "YWLoginTool.h"
#import "YWMacro.h"
#import "YWMission.h"
#import "YWMissionManager.h"
#import "YWRoundImageView.h"
#import "Masonry.h"
#import "YWWorkTableViewCell.h"
#import "YWDetectAndUpkeepManager.h"
#import "YWReplyManager.h"
#import "YYLabel.h"

@interface YWDetailWorkTableViewCell()
//追踪 track
@property (nonatomic, strong) YYLabel *trackLable;
//头像
@property (nonatomic, strong) UIImageView *headImageView;
//时间 小Lable
@property (nonatomic, strong) YYLabel *littleTimeLable;
//编号
@property (nonatomic, strong) YYLabel *numberLabel;
//设备名
@property (nonatomic, strong) YYLabel *deviceNameLabel;
//来自 fromPeopleLable
@property (nonatomic, strong) YYLabel *fromPeopleLable;
//执行人 executerLable
@property (nonatomic, strong) YYLabel *executerLable;
//已巡查设备patrolEquipmentLable
@property (nonatomic, strong) YYLabel *patrolEquipmentLable;
@property (nonatomic, strong) YYLabel *endTimeLable;
//位置locationLable
@property (nonatomic, strong) YYLabel *locationLable;
//任务循环周期
@property (nonatomic, strong) YYLabel* cycleNameLabel;
//保养|检测 设备总数
@property (nonatomic, strong) YYLabel* equipmentForInspectionLable;
//备注
@property (nonatomic, strong) YYLabel *noteLabel;
//状态图
//@property (nonatomic, strong) YWAnimationView *statusImageview;
@property (nonatomic, strong) UIImageView * statusImageview;
@property (nonatomic, strong) UIView *lineView;
//设备总数 totalEquipmentLable
@property (nonatomic, strong) YYLabel *totalEquipment;
@property (nonatomic, strong) YYLabel *hasFinishEquipment;
///** 评论图标 */
//@property (nonatomic, strong) UIImageView *replyIcon;
///** 评论数量 */
//@property (nonatomic, strong) YYLabel *replyNumberLabel;
///** 参与者图标 */
//@property (nonatomic, strong) UIImageView *observerIcon;
///** 参与者数量 */
//@property (nonatomic, strong) YYLabel *observerNumberLabel;
@end

@implementation YWDetailWorkTableViewCell

+ (instancetype)cellWithTableView:(UITableView *)tableView
{
    YWDetailWorkTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:YWDetailWorkTableViewCellIdentifier];
    if (cell == nil) {
        cell = [[YWDetailWorkTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:YWDetailWorkTableViewCellIdentifier];
    }
    return cell;
}

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.layer.shouldRasterize = YES;
        self.layer.rasterizationScale = [UIScreen mainScreen].scale;
        [self setUpSubviews];
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        self.separatorInset = UIEdgeInsetsMake(0, SCREEN_WIDTH, 0, 0);
    }
    return self;
}
//- (void)setShowFinishState:(YWAnimationViewShowStatus)animationViewShowStatus
//{
//    self.statusImageview.showStatus = animationViewShowStatus;
//}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
}

- (void)setIsHistorical:(BOOL)isHistorical
{
    _isHistorical = isHistorical;
}

- (void)setMaintenanceMission:(YWMaintenanceMission*)maintenanceMission
{
    _maintenanceMission = maintenanceMission;
    NSString* typeName = [YWCommonTool maintenanceTypeOfMaintenanceTypeId:maintenanceMission.maintenanceTypeId];
    //    右上角时间
    if (_isHistorical) {
        _littleTimeLable.text = [YWCommonTool showTimeWithNormalFormatter:maintenanceMission.finishTime / 1000];
    }
    else {
        _littleTimeLable.text = [YWCommonTool showTimeWithNormalFormatter:maintenanceMission.createTime / 1000];
    }
    //    头像
    NSString* downloadUrl = [YWCommonTool pictureDownloadUrl:_maintenanceMission.creator.headIcon];
    [_headImageView sd_setImageWithURL:[NSURL URLWithString:downloadUrl] placeholderImage:[UIImage imageNamed:@"profile_headimage"]];
    //来自
    self.fromPeopleLable.text = maintenanceMission.creator.userName ? maintenanceMission.creator.userName : NSLocalizedString(@"none", nil);
    //    编号
    _numberLabel.attributedText = [YWCommonTool attributedTextWithFirstText:NSLocalizedString(@"codeFormatter", nil) firstColor:[UIColor customTextGrayBlackColor] secondText:maintenanceMission.missionSequence ?:@"" secondColor:[UIColor customYellowColor] font:kContentFont];
    //执行人
    NSString *executorName = [YWCommonTool handlerNamesWithHandlers:maintenanceMission.executors];
    _executerLable.attributedText = [YWCommonTool attributedTextWithFirstText:[NSString stringWithFormat:@"%@人: ",typeName] firstColor:[UIColor customTextGrayBlackColor] secondText:executorName secondColor:[UIColor customYellowColor] font:kContentFont];
    //    设备类型名
    NSString *equipmentTypeName = [[YWEquipmentManager shareManager] equipmentTypeNameWithTypeId:maintenanceMission.equipmentTypeId];
    _deviceNameLabel.attributedText = [YWCommonTool attributedTextWithFirstText:NSLocalizedString(@"equipmentFormatter", nil) firstColor:[UIColor customTextGrayBlackColor] secondText:equipmentTypeName secondColor:[UIColor blackColor] font:kContentFont];
    //    位置
    NSString *locationStr = [[YWBuildingManager shareManager] buildingWithId:maintenanceMission.buildingId].buildingName?:@"";
    _locationLable.attributedText = [YWCommonTool attributedTextWithFirstText:NSLocalizedString(@"locationFormatter", nil) firstColor:[UIColor customTextGrayBlackColor] secondText:locationStr secondColor:[UIColor blackColor] font:kContentFont];
    //     任务循环周期
    NSString *cycleString = [YWDetectAndUpkeepManager missionCycleStringWithCycle:maintenanceMission.missionCycle];
    _cycleNameLabel.attributedText = [YWCommonTool attributedTextWithFirstText:NSLocalizedString(@"missionCycleFormatter", nil) firstColor:[UIColor customTextGrayBlackColor] secondText:cycleString?:@"" secondColor:[UIColor blackColor] font:kContentFont];
    //检测设备总数
    NSString *equipmentQuantity = [NSString stringWithFormat:@"%ld%@",(long)maintenanceMission.equipmentQuantity,NSLocalizedString(@"ge", nil)];
    _equipmentForInspectionLable.attributedText = [YWCommonTool attributedTextWithFirstText:[NSString stringWithFormat:@"%@%@: ", typeName,NSLocalizedString(@"equipmentCount", nil)] firstColor:[UIColor customTextGrayBlackColor] secondText:equipmentQuantity secondColor:[UIColor customYellowColor] font:kContentFont];
    //最后一行 设备总数
    _totalEquipment.attributedText = [YWCommonTool attributedTextWithFirstText:NSLocalizedString(@"equipmentCountFormatter", nil) firstColor:[UIColor customTextGrayBlackColor] secondText:equipmentQuantity secondColor:[UIColor customYellowColor] font:kContentFont];
    //已检测设备
    NSString *completedQuantity = [NSString stringWithFormat:@"%ld个",(long)maintenanceMission.completedQuantity];
    _patrolEquipmentLable.attributedText = [YWCommonTool attributedTextWithFirstText:[NSString stringWithFormat:@"已%@%@: ", typeName,NSLocalizedString(@"equipment", nil)] firstColor:[UIColor customTextGrayBlackColor] secondText:completedQuantity secondColor:[UIColor customYellowColor] font:kContentFont];

    //最后一行 已完成设备
    _hasFinishEquipment.attributedText = [YWCommonTool attributedTextWithFirstText:@"已完成: " firstColor:[UIColor customTextGrayBlackColor] secondText:completedQuantity secondColor:[UIColor customYellowColor] font:kContentFont];
    //进度跟踪
    if ([maintenanceMission.executorIds rangeOfString:[@([YWLoginTool loginUser].uniqueId) stringValue]].location == NSNotFound) {
        _trackLable.text = NSLocalizedString(@"followTheProgress", nil);//@"进度跟踪";
    }
    else {
        _trackLable.text = @"";
    }
    //    截止时间
    NSString *cutoffTime = [YWCommonTool showTime:maintenanceMission.cutoffTime / 1000 andFormatter:KTimeFormatFullDate];
    _endTimeLable.attributedText = [YWCommonTool attributedTextWithFirstText:NSLocalizedString(@"deadlineFormatter", nil) firstColor:[UIColor customTextGrayBlackColor] secondText:cutoffTime secondColor:[UIColor blackColor] font:kContentFont];
//    NSInteger day = [YWCommonTool getDaysFrom:[NSDate date] To:[NSDate dateWithTimeIntervalSince1970:maintenanceMission.cutoffTime / 1000]];
    if (maintenanceMission.missionStatus == YWMissionStatusFinished) {
        [_statusImageview setImage:[UIImage imageNamed:@"mission_newfinished"]];
    }
//    else if (day < 0) {
//        [self setShowFinishState:YWAnimationViewShowStatusExpired];
//    }
//    else if (day < kMaxExpireDay) {
//        [self setShowFinishState:YWAnimationViewShowStatusExpire];
//    }
    else if(maintenanceMission.missionStatus == YWMissionStatusExpire){
        [_statusImageview setImage:[UIImage imageNamed:@"mission_expire"]];
    }else{
        if (maintenanceMission.status == -1) {
            [_statusImageview setImage:[UIImage imageNamed:@"mission_delete"]];
        }
    }
    //状态图类型
//    _statusImageview.type = YWAnimationViewTypeRectangle;
    //备注
    NSString * noteText = maintenanceMission.note.length ?maintenanceMission.note : NSLocalizedString(@"none", nil);
    _noteLabel.attributedText = [YWCommonTool attributedTextWithFirstText:NSLocalizedString(@"noteFormatter", nil) firstColor:[UIColor customTextGrayBlackColor] secondText:noteText secondColor:[UIColor blackColor] font:kContentFont];
    
//    //    评论
//    NSInteger replyCount = 0;
//    if (maintenanceMission.missionId>0) {
//        replyCount = [[YWReplyManager shareManager] replysCountWithtRelationId:maintenanceMission.missionId relationType:YWReplyRelationTypeDetectAndUpkeep];
//    }
//    _replyNumberLabel.text = [@(replyCount) stringValue];
//    //参与者
//    NSInteger observerCount = maintenanceMission.executors.count;
//    NSInteger uniqueId = maintenanceMission.creator.uniqueId;
//    NSPredicate *searchPredicate = [NSPredicate predicateWithFormat:@"%K = %ld", @"uniqueId", uniqueId];
//    NSArray *array = [[maintenanceMission.executors filteredArrayUsingPredicate:searchPredicate] mutableCopy];
//    if (array.count==0) {
//        observerCount++;
//    }
//    if (maintenanceMission.observers.count>0) {
//        observerCount = observerCount + maintenanceMission.observers.count;
//    }
//    _observerNumberLabel.text = [@(observerCount) stringValue];
    
    
    self.noteLabel.preferredMaxLayoutWidth = self.noteLabel.frame.size.width;
    self.executerLable.preferredMaxLayoutWidth = self.executerLable.frame.size.width;
    self.deviceNameLabel.preferredMaxLayoutWidth = self.deviceNameLabel.frame.size.width;
    self.locationLable.preferredMaxLayoutWidth = self.locationLable.frame.size.width;
    self.cycleNameLabel.preferredMaxLayoutWidth = self.cycleNameLabel.frame.size.width;
}

- (void)setUpSubviews {
    UIView *superview = self.contentView;
    /**
     *  头像 名字
     *  头像 时间
     */
    [self.headImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.and.top.mas_equalTo(superview).offset(8);
        make.width.and.height.mas_equalTo(@46);
    }];
    
    [self.fromPeopleLable mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.mas_equalTo(_headImageView.mas_centerY).offset(-2);
        make.left.mas_equalTo(_headImageView.mas_right).offset(6);
    }];
    
    [self.littleTimeLable mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(_fromPeopleLable);
        make.top.mas_equalTo(_fromPeopleLable.mas_bottom).offset(4);
    }];
    /**
     *  编号
     *  检测人         进度追踪
     *  设备
     *  位置
     *  任务循环周期
     *  检测设备总数   已检测设备
     *  截止时间
     *  备注
     *  ________________状态图
     *  总设备数         已完成
     */
    
    [self.numberLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(_headImageView.mas_bottom).offset(6);
        make.left.mas_equalTo(superview).offset(8);
        make.right.mas_equalTo(superview).offset(-8);
    }];
    
    [self.executerLable mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(_numberLabel.mas_bottom).offset(6);
        make.left.mas_equalTo(superview).offset(8);
        make.right.mas_equalTo(superview).offset(-72);
    }];
    
    [self.trackLable mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(_numberLabel);
        make.width.mas_equalTo(@64);
        make.right.mas_equalTo(superview).offset(-8);
    }];
    
    [self.deviceNameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(_executerLable.mas_bottom).offset(6);
        make.left.mas_equalTo(superview).offset(8);
        make.right.mas_equalTo(superview).offset(-72);
    }];
    
    [self.locationLable mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(_deviceNameLabel.mas_bottom).offset(6);
        make.left.mas_equalTo(superview).offset(8);
        make.right.mas_equalTo(superview).offset(-72);
    }];
    
    [self.cycleNameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(_locationLable.mas_bottom).offset(6);
    }];
    
    [self.equipmentForInspectionLable mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(_cycleNameLabel.mas_bottom).offset(6);
        make.left.mas_equalTo(_numberLabel);
        make.right.mas_equalTo(superview.mas_centerX).offset(10);
    }];
    
    [self.patrolEquipmentLable mas_makeConstraints:^(MASConstraintMaker *make) {
        make.baseline.mas_equalTo(_equipmentForInspectionLable);
        make.left.mas_equalTo(superview.mas_centerX).offset(15);
    }];
    
    [self.endTimeLable mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(_equipmentForInspectionLable.mas_bottom).offset(6);
        make.left.and.right.mas_equalTo(@[_numberLabel, _cycleNameLabel]);
    }];
    
    
    [self.noteLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(_endTimeLable.mas_bottom).offset(6);
        make.left.mas_equalTo(_numberLabel);
        make.right.mas_equalTo(superview).offset(-8);
        make.bottom.mas_equalTo(superview).offset(-6);
    }];
    
    [self.statusImageview mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.top.mas_equalTo(_noteLabel.mas_bottom).offset(6);
//        make.right.mas_equalTo(superview);
//        make.size.mas_equalTo(CGSizeMake(70, 20));
        make.top.mas_equalTo(_executerLable);
        make.right.mas_equalTo(superview).offset(-8);
        make.size.mas_equalTo(CGSizeMake(64, 64));
        //make.bottom.mas_equalTo(_noteLabel.mas_bottom);
    }];
    /*
    [self.replyIcon mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.bottom.mas_equalTo(_statusImageview);
        make.top.mas_equalTo(_noteLabel.mas_bottom).offset(6);
        make.width.mas_equalTo(@23);
        make.height.mas_equalTo(@23);
    }];
    [self.replyNumberLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(_replyIcon);
        make.left.mas_equalTo(self.replyIcon.mas_right).offset(8);
        make.right.mas_equalTo(superview).offset(-10);
        make.bottom.mas_equalTo(_replyIcon.mas_bottom);
        make.width.mas_lessThanOrEqualTo(@80);
    }];
    [self.observerIcon mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.mas_equalTo(_replyNumberLabel);
        make.width.mas_equalTo(@23);
        make.height.mas_equalTo(@23);
    }];
    [self.observerNumberLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(_observerIcon);
        make.left.mas_equalTo(_observerIcon.mas_right).offset(8);
        make.right.mas_equalTo(_replyIcon.mas_left).offset(-15);
        make.bottom.mas_equalTo(_observerIcon.mas_bottom);
        make.width.mas_lessThanOrEqualTo(@80);
    }];
    [self.lineView mas_makeConstraints:^(MASConstraintMaker *make) {
        //make.top.mas_equalTo(_noteLabel.mas_bottom).offset(5);
        make.top.mas_equalTo(_replyIcon.mas_bottom);
        make.left.and.right.mas_equalTo(superview);
        make.height.mas_equalTo(@1);
    }];
    
    [self.totalEquipment mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(_lineView.mas_bottom).offset(6);
        make.left.mas_equalTo(_numberLabel);
        make.bottom.mas_equalTo(superview).offset(-6);
    }];

    [self.hasFinishEquipment mas_makeConstraints:^(MASConstraintMaker *make) {
        make.baseline.mas_equalTo(_totalEquipment);
        make.left.mas_equalTo(_patrolEquipmentLable);
    }];
     */
}

//- (void)layoutSubviews{
//    [super layoutSubviews];
//    
//}

- (UIImageView *)headImageView{
    if (!_headImageView) {
        UIImageView *imageView = [UIImageView new];
        imageView.layer.masksToBounds = YES;
        imageView.layer.cornerRadius = 46/2;
        _headImageView = imageView;
        [self.contentView addSubview:_headImageView];
    }
    return _headImageView;
}

- (YYLabel *)fromPeopleLable{
    if (!_fromPeopleLable) {
        YYLabel *label = [[YYLabel alloc] init];
        label.font = kContentFont;
        label.textColor = [UIColor blackColor];
        _fromPeopleLable = label;
        [self.contentView addSubview:_fromPeopleLable];
    }
    return _fromPeopleLable;
}

- (YYLabel *)littleTimeLable{
    if (!_littleTimeLable) {
        YYLabel *label = [[YYLabel alloc] init];
        label.font = kContentFont;
        label.textColor = [UIColor customTextGrayBlackColor];
        _littleTimeLable = label;
        [self.contentView addSubview:_littleTimeLable];
    }
    return _littleTimeLable;
}

- (YYLabel *)numberLabel{
    if (!_numberLabel) {
        YYLabel *label = [[YYLabel alloc] init];
        _numberLabel = label;
        [self.contentView addSubview:_numberLabel];
    }
    return _numberLabel;
}

- (YYLabel *)executerLable{
    if (!_executerLable) {
        YYLabel *label = [[YYLabel alloc] init];
        label.numberOfLines = 0;
        _executerLable = label;
        [self.contentView addSubview:_executerLable];
    }
    return _executerLable;
}

- (YYLabel *)trackLable{
    if (!_trackLable) {
        YYLabel *label = [[YYLabel alloc] init];
        label.font = kContentFont;
        label.textColor = [UIColor customBlueColor];
        _trackLable = label;
        [self.contentView addSubview:_trackLable];
    }
    return _trackLable;
}

- (YYLabel *)deviceNameLabel{
    if (!_deviceNameLabel) {
        YYLabel *label = [[YYLabel alloc] init];
        label.numberOfLines = 0;
        _deviceNameLabel = label;
        [self.contentView addSubview:_deviceNameLabel];
    }
    return _deviceNameLabel;
}

- (YYLabel *)locationLable{
    if (!_locationLable) {
        YYLabel *label = [[YYLabel alloc] init];
        label.numberOfLines = 0;
        _locationLable = label;
        [self.contentView addSubview:_locationLable];
    }
    return _locationLable;
}

- (YYLabel *)cycleNameLabel{
    if (!_cycleNameLabel) {
        YYLabel *label = [[YYLabel alloc] init];
        label.numberOfLines = 0;
        _cycleNameLabel = label;
        [self.contentView addSubview:_cycleNameLabel];
    }
    return _cycleNameLabel;
}


- (YYLabel *)equipmentForInspectionLable{
    if (!_equipmentForInspectionLable) {
        YYLabel *label = [[YYLabel alloc] init];
        _equipmentForInspectionLable = label;
        [self.contentView addSubview:_equipmentForInspectionLable];
    }
    return _equipmentForInspectionLable;
}

- (YYLabel *)patrolEquipmentLable{
    if (!_patrolEquipmentLable) {
        YYLabel *label = [[YYLabel alloc] init];
        _patrolEquipmentLable = label;
        [self.contentView addSubview:_patrolEquipmentLable];
    }
    return _patrolEquipmentLable;
}

- (YYLabel *)endTimeLable{
    if (!_endTimeLable) {
        YYLabel *label = [[YYLabel alloc] init];
        _endTimeLable = label;
        [self.contentView addSubview:_endTimeLable];
    }
    return _endTimeLable;
}

- (YYLabel *)noteLabel{
    if (!_noteLabel) {
        YYLabel *label = [[YYLabel alloc] init];
        label.numberOfLines = 0;
        _noteLabel = label;
        [self.contentView addSubview:_noteLabel];
    }
    return _noteLabel;
}

//-(YWAnimationView *)statusImageview{
//    if (!_statusImageview) {
//        YWAnimationView *imageView = [YWAnimationView new];
//        _statusImageview = imageView;
//        [self.contentView addSubview:_statusImageview];
//    }
//    return _statusImageview;
//}
- (UIImageView*)statusImageview{
    if (!_statusImageview) {
        UIImageView *imageView = [UIImageView new];
        imageView.layer.masksToBounds = YES;
        imageView.layer.cornerRadius = 32;
        _statusImageview = imageView;
        [self.contentView addSubview:_statusImageview];
    }
    return _statusImageview;
}

-(UIView *)lineView{
    if (!_lineView) {
        UIView *lineView = [UIView new];
        lineView.backgroundColor = [UIColor customLineColor];
        _lineView = lineView;
        [self.contentView addSubview:_lineView];
    }
    return _lineView;
}

- (YYLabel *)totalEquipment{
    if (!_totalEquipment) {
        YYLabel *label = [[YYLabel alloc] init];
        _totalEquipment = label;
        [self.contentView addSubview:_totalEquipment];
    }
    return _totalEquipment;
}

- (YYLabel *)hasFinishEquipment{
    if (!_hasFinishEquipment) {
        YYLabel *label = [[YYLabel alloc] init];
        _hasFinishEquipment = label;
        [self.contentView addSubview:_hasFinishEquipment];
    }
    return _hasFinishEquipment;
}

//- (YYLabel *)replyNumberLabel{
//    if (!_replyNumberLabel) {
//        YYLabel *label = [[YYLabel alloc] init];
//        label.font = kContentFont;
//        label.textColor = [UIColor customTextGrayBlackColor];
//        _replyNumberLabel = label;
//        [self.contentView addSubview:_replyNumberLabel];
//    }
//    return _replyNumberLabel;
//}
//
//- (UIImageView *)replyIcon{
//    if (!_replyIcon) {
//        UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"remind_replyIcon"]];
//        _replyIcon = imageView;
//        [self.contentView addSubview:_replyIcon];
//    }
//    return _replyIcon;
//}
//
//- (UIImageView *)observerIcon{
//    if (!_observerIcon) {
//        UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"common_members"]];
//        _observerIcon = imageView;
//        [self.contentView addSubview:_observerIcon];
//    }
//    return _observerIcon;
//}

//- (YYLabel *)observerNumberLabel{
//    if (!_observerNumberLabel) {
//        YYLabel *label = [[YYLabel alloc] init];
//        label.font = kContentFont;
//        label.textColor = [UIColor customTextGrayBlackColor];
//        _observerNumberLabel = label;
//        [self.contentView addSubview:_observerNumberLabel];
//    }
//    return _observerNumberLabel;
//}

@end
